import React, {Component} from 'react';

import FilterFoot from "../../../../components/FilterFoot/FilterFoot";
import { PickerView, WhiteSpace } from 'antd-mobile';

class FilterPicker extends Component {
    state ={
        value:this.props.defaultValue
    };
    onChange = (value) => {
      this.setState({value})
    };
    onScrollChange = (value) => {
        // console.log(value);
    };
    render() {
        const {onCancle,onSave,data,cols,type} = this.props;
        return (
            <div>
                <WhiteSpace /><WhiteSpace />
                <PickerView
                    data={data}
                    value={this.state.value}
                    cols={cols}
                    onChange={this.onChange}
                    onScrollChange={this.onScrollChange}
                />
                <FilterFoot onCancle={onCancle} onOk={() =>onSave(type,this.state.value)} onText='取消'/>
            </div>
        );
    }
}

export default FilterPicker;
